ImageTexture

open class ImageTexture(image: ImageData) : Texture

iOS GL texture backed by tightly-packed RGBA8 bytes from ImageDecoder. The pixel format is fixed to RGBA8 (premultiplied) — same as Android and JS — so the standard texImage2D(ByteArray) overload can upload directly without extra format conversion.

Lifecycle: holds a strong reference to rgbaBytes until the first allocTexImage call, then drops it so the CPU copy can be GC'd while the GPU keeps the texture.

Constructors

Link copied to clipboard
constructor(image: ImageData)

Properties

Link copied to clipboard
Link copied to clipboard
val coordTransform: Matrix3
Link copied to clipboard

Caller opt-out for mipmap generation.

Link copied to clipboard
val height: Int
Link copied to clipboard
val target: Int
Link copied to clipboard
val width: Int

Functions

Link copied to clipboard
open fun bindTexture(dc: DrawContext): Boolean
Link copied to clipboard
fun getTexParameter(name: Int): Int
Link copied to clipboard
fun getTextureName(dc: DrawContext): KglTexture
Link copied to clipboard
open override fun release(dc: DrawContext)

Frees any resources associated with this instance. After this method returns the rendering resource is invalid, and any associated GL object is deleted.

Link copied to clipboard
fun setTexParameter(name: Int, param: Int)